<%-- 
    Document   : Listar
    Created on : 30/10/2012, 04:58:46 PM
    Author     : Sigifredo Escobar Gómez
--%>

<%@page import="empresa.*" %>
<%@page import="java.util.List" %>
<%@page import="java.util.Iterator" %>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
<h1>LISTA DE EMPRESAS</h1>
<%
    ConsultaEmpresa con = new ConsultaEmpresa();
    List em = con.getEmpresa();
    Iterator it = em.iterator();
    out.println("<TABLE border=10 cellpadding=5><tr>");
    out.println("<th bgcolor=green>RUT</th><th bgcolor=white>NOMBRE</th><th bgcolor=red>DIRECCION</th></tr>");

    while(it.hasNext()) {
        Empresa e = (Empresa) it.next();
        out.println("<TR>");
        out.println("<TD>" + e.getRut() + "</TD>");
        out.println("<TD>" + e.getNombre() + "</TD>");
        out.println("<TD>" + e.getDireccion() + "</TD>");
        out.println("</TR>");
    }

    out.println("</TABLE>");
%>
    </body>
</html>
